/**
 * Created by Joseph on 12/04/2015.
 */
(function () {
    'use strict';

    angular.module('app.musculos')
        .service('MusculosService', ['restBaseUrl', '$http', MusculosService]);

    function MusculosService (restBaseUrl, $http) {

        var serviceName = 'MusculosService.svc/';

        this.Listar = function () {
            var req = {
                method: 'GET',
                url: restBaseUrl + serviceName + 'Listar'
            };

            return $http(req);
        };

        this.ListarMusculosPrimarios = function (idEjericio) {
            var req = {
                    method: 'GET',
                    url: restBaseUrl + serviceName + 'ListarMusculosPrimarios',
                    data: {
                        'idEjericio': idEjericio
                    }
                };
            return $http(req);
        };

        this.Eliminar= function(idMusculo){

            var req = {
                method: 'DELETE',
                url: restBaseUrl + serviceName + 'Delete',
                data: {id : idMusculo}

            };
            return $http(req);

        };

        this.Constantes= function(){

            var req = {
                method: 'GET',
                url: restBaseUrl + serviceName + 'ConstantesMusculos'
            };
            return $http(req);


        };

        this.Registrar=function(musculo){


            var req = {
                method: 'POST',
                url: restBaseUrl + serviceName + 'Create',
                data: musculo,
				headers: {
                    "Content-Type": "text/plain"
                }

            };
            return $http(req);

        };

        this.Modificar = function(musculo){

            var req = {
                method: 'PUT',
                url: restBaseUrl + serviceName + 'Update',
                data: musculo,
				headers: {
                    "Content-Type": "text/plain"
                }

            };
            return $http(req);
        };

    }
})();